import request from '@/config/axios'

// 获得客户标签集分页
export const getCustomerTagPage = async (params) => {
  return await request.get({ url: `/crm/label-set/page`, params })
}
// 获得客户标签集分页-默认
export const getCustomerTagPageDefault = async (params) => {
  return await request.get({ url: `/crm/label-set/page-default`, params })
}
//创建客户标签集
export const createlabelSet = async (data) => {
  return await request.post({ url: `/crm/label-set/create`, data })
}
//创建客户标签集-默认
export const createlabelSetDefault = async (data) => {
  return await request.post({ url: `/crm/label-set/create-default`, data })
}
// 更新客户标签集
export const updatelabelSet = async (data) => {
  return await request.put({ url: `/crm/label-set/update`, data })
}
// 更新客户标签集-默认
export const updatelabelSetDefault = async (data) => {
  return await request.put({ url: `/crm/label-set/update-default`, data })
}
// 删除客户标签集
export const deletelabel = async (id: number) => {
  return await request.delete({ url: `/crm/label-set/delete?id=` + id })
}
// 删除客户标签集-默认
export const deletelabelDefault = async (id: number) => {
  return await request.delete({ url: `/crm/label-set/delete-default?id=` + id })
}
// 获得客户标签集
export const getCustomerTag = async (id) => {
  return await request.get({ url: `/crm/label-set/get?id=${id}` })
}
// 获得客户标签集-默认
export const getCustomerTagDefault = async (id) => {
  return await request.get({ url: `/crm/label-set/get-default?id=${id}` })
}
// 获得客户标签分页
export const getTagPage = async (params) => {
  return await request.get({ url: `/crm/label/page`, params })
}
//创建客户标签
export const createlabel = async (data) => {
  return await request.post({ url: `/crm/label/create`, data })
}
//创建客户标签-默认
export const createlabelDefault = async (data) => {
  return await request.post({ url: `/crm/label/create-default`, data })
}
// 更新客户标签
export const updatelabel = async (data) => {
  return await request.put({ url: `/crm/label/update`, data })
}
// 更新客户标签-默认
export const updatelabelDefault = async (data) => {
  return await request.put({ url: `/crm/label/update-default`, data })
}
// 删除客户标签
export const deleteTag = async (id: number) => {
  return await request.delete({ url: `/crm/label/delete?id=` + id })
}
// 删除客户标签-默认
export const deleteTagDefault = async (id: number) => {
  return await request.delete({ url: `/crm/label/delete-default?id=` + id })
}
// 获得客户标签
export const getTaglabel = async (id) => {
  return await request.get({ url: `/crm/label/get?id=${id}` })
}
// 获得客户标签-默认
export const getTaglabelDefault = async (id) => {
  return await request.get({ url: `/crm/label/get-default?id=${id}` })
}
// 线索批量添加标签
export const batchUpdateLabel = async (data) => {
  return await request.post({ url: `/crm/clue/batch-update-label`, data })
}
// 客户批量添加标签
export const batchCustomerUpdateLabel = async (data) => {
  return await request.post({ url: `/crm/customer/batch-update-label`, data })
}

/**客户级别配置*/
// 客户级别列表
export const getCustomerLevelPage = async (params) => {
  return await request.get({ url: `/crm/level-config/page`, params })
}
// 客户级别列表-默认
export const getCustomerLevelPageDefault = async (params) => {
  return await request.get({ url: `/crm/level-config/page-default`, params })
}
// 创建客户级别
export const createLevelSet = async (data) => {
  return await request.post({ url: `/crm/level-config/create`, data })
}
// 创建客户级别-默认
export const createLevelSetDefault = async (data) => {
  return await request.post({ url: `/crm/level-config/create-default`, data })
}
// 更新客户级别
export const updateLevelSet = async (data) => {
  return await request.put({ url: `/crm/level-config/update`, data })
}
// 更新客户级别-默认
export const updateLevelSetDefault = async (data) => {
  return await request.put({ url: `/crm/level-config/update-default`, data })
}
// 删除客户级别
export const deleteLevel = async (id: number) => {
  return await request.delete({ url: `/crm/level-config/delete?id=` + id })
}
// 删除客户级别-默认
export const deleteLevelDefault = async (id: number) => {
  return await request.delete({ url: `/crm/level-config/delete-default?id=` + id })
}
// 获得客户级别
export const getCustomerLevel = async (id) => {
  return await request.get({ url: `/crm/level-config/get?id=${id}` })
}
// 获得客户级别-默认
export const getCustomerLevelDefault = async (id) => {
  return await request.get({ url: `/crm/level-config/get-default?id=${id}` })
}
// 客户级别字典
export const getLevelSimple = async () => {
  return await request.get({ url: `/crm/level-config/simple-list` })
}
